﻿#region Using

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

#endregion

namespace GameCommon.Base
{
    public class Sprite
    {
        private float layer;

        public Sprite(Texture2D texture, Rectangle destinationRect, Rectangle? sourceRectangle, Color color, int layer)
        {
            this.Rotation = 0f;
            this.Origin = new Vector2();
            this.SpriteEffects = SpriteEffects.None;
            this.DestinationRectangle = destinationRect;
            this.SourceRectangle = sourceRectangle;
            this.Texture2D = texture;
            this.Color = color;
            this.Layer = layer;
        }

        public Texture2D Texture2D { get; private set; }

        public Rectangle DestinationRectangle { get; private set; }

        public Rectangle? SourceRectangle { get; private set; }

        public Color Color { get; private set; }

        public float Rotation { get; private set; }

        public Vector2 Origin { get; private set; }

        public SpriteEffects SpriteEffects { get; private set; }

        public float Layer
        {
            get
            {
                return this.layer / 100f;
            }

            private set
            {
                this.layer = value;
            }
        }
    }
}